<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AlterProductMenusAddTop extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('product_menus', function (Blueprint $table) {
            $table->unsignedInteger('isTop')->default(0)->after('desc')->comment('置顶状态 0 - 未置顶 1 - 置顶');
            $table->unsignedInteger('topTime')->default(0)->after('isTop')->comment('置顶时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('product_menus', function (Blueprint $table) {
            $table->dropColumn(["isTop", "topTime"]);
        });
    }
}
